home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / rexx / transamiga / checkfiles.rexx
OS/2 REXX Batch file  |  1996-01-24  |  1KB  |  41 lines

  1. /* Xtrude.rexx */
  2.  
  3. /* Test script for Xtruder. This is pieces taken from a longer
  4.    script which performs various checks on BBS uploads. 'Load_VC'
  5.    is a subroutine in that program. Note: Waitforport times out
  6.    after 10 seconds. I've never found loading Xtruder takes more
  7.    than 2 or 3 seconds, so maybe the 'for' loop is unnecessary.
  8. */
  9.  
  10. options results
  11.  
  12. VCdir =  'work1:utilities.1/xtruder/'    /* Path to your virus checker */
  13. TestDir = 'BBS:test'               /* directory holding files for test */
  14.  
  15.  
  16. Load_VC:
  17.   response=0
  18.   if ~show(Ports,'XTRUDER') then do
  19.     if exists(VCdir||'Xtruder') then do
  20.         address command 'run <>nil: '||VCdir||'Xtruder'
  21.         do i=1 to 3
  22.           address command 'waitforport XTRUDER'
  23.           if RC=0 then leave
  24.         end
  25.     end
  26.     if ~show(Ports,'XTRUDER') then response=10
  27.   end
  28.  
  29.   if response>0 then exit 20  /* ... or whatever you want to do */
  30.  
  31.   address 'XTRUDER' 'Checkfiles '||TestDir
  32.   vircount = RC
  33.  
  34.   if vircount < 0 then do
  35.     say 'Unable to do check. Xtruder error code '||vircount
  36.     vircount=0
  37.   end
  38.   if vircount >0 then do
  39.     say 'Found a Virus!'      /* ... or whatever you want to do */
  40.   end
  41.